package com.mining.app.zxing.view;

import com.sensoro.factoryconfig.R;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.widget.ImageView;

/** * Created by fyu on 4/11/14. */
public class WaveImageView extends ImageView {
	private Paint paint;
	private float strokeWidth;

	public WaveImageView(Context context) {
		super(context);
	}
	
	public WaveImageView(Context context, float width) {
		super(context);
		paint = new Paint();
		paint.setAntiAlias(true);
		paint.setColor(getResources().getColor(R.color.ripple));
		paint.setStyle(Paint.Style.STROKE);
		strokeWidth = width;
		paint.setStrokeWidth(width);
	}

	@Override
	protected void onDraw(Canvas canvas) {
		int radius = getWidth() / 2;
		canvas.drawCircle(radius, radius, radius - strokeWidth, paint);
	}
	
	public void setPaintWidth(float width){
		paint.setStrokeWidth(width);
	}
	
}